package com.idealighter.game.roomcard.struct.gamgcfg.value;

import com.idealighter.game.roomcard.games.mustniuniu.constant.MustNiuNiuAdvanceOption;
import com.idealighter.game.roomcard.struct.RoomCardGameCfgValue;
import java.util.List;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

@Data
public class NiuNiuRoomCardGameCfgValue implements RoomCardGameCfgValue {
  private NiuNiuBeBankerGameInfoCfgPo niuniuBeBanker;
  private OwnerBeBankerGameInfoCfgPo ownerBeBanker;
  private FreeCallBankerGameInfoCfgPo freeCallBanker;
  private ShowCardCallBankerGameInfoCfgPo showCardCallBanker;

  @Data
  public static class BasicGameInfoPo {
    private List<MustNiuNiuBetOptionPo> betOptions;
    private List<MustNiuNiuRoundPo> rounds;
    private List<Integer> fees; // 费用编号
    private List<MustNiuNiuStartOptionPo> startOptions;
    private List<MustNiuNiuSeatPo> seats;
    private List<MustNiuNiuExtrBetOptionPo> extrBetOptions;
    private List<MustNiuNiuCardMultiplePo> multiples;
    private List<MustNiuNiuCardSpecialMultiplePo> specialMultiples;
    private List<MustNiuNiuAdvanceOptionPo> advanceOptions;
  }

  public static class FreeCallBankerGameInfoCfgPo extends BasicGameInfoPo {
  }

  public static class NiuNiuBeBankerGameInfoCfgPo extends BasicGameInfoPo {
  }

  @Getter
  @Setter
  public static class OwnerBeBankerGameInfoCfgPo extends BasicGameInfoPo {
    private List<MustNiuNiuBankerChipPo> bankerChips;
  }

  @Getter
  @Setter
  public static class ShowCardCallBankerGameInfoCfgPo extends BasicGameInfoPo {
    private List<MustNiuNiuCallBankerMultiplePo> callBankerMultiples;
  }

  @Data
  public static class MustNiuNiuBetOptionPo {
    private int id;
    private List<Integer> betChips;
    private String name;

    public MustNiuNiuBetOptionPo() {}

    /**
     * 构造函数.
     */
    public MustNiuNiuBetOptionPo(int id, List<Integer> betChips, String name) {
      this.id = id;
      this.betChips = betChips;
      this.name = name;
    }

    /**
     * @Title findMinBetChip.
     * @Description 虎丘最低下注筹码
     * @date 2018年6月14日 下午4:31:11
     * @return .
     */
    public Integer findMinBetChip() {
      int min = betChips.get(0);
      for (Integer item : betChips) {
        if (min > item) {
          min = item;
        }
      }
      return min;
    }
  }

  @Data
  public static class MustNiuNiuRoundPo {
    private int round;
    private String name;

    public MustNiuNiuRoundPo() {}

    public MustNiuNiuRoundPo(int round, String name) {
      this.round = round;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuStartOptionPo {
    private int id;
    private int persons;
    private String name;

    public MustNiuNiuStartOptionPo() {}

    /**
     * 构造函数.
     */
    public MustNiuNiuStartOptionPo(int id, int persons, String name) {
      this.id = id;
      this.persons = persons;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuSeatPo {
    private int seat;
    private String name;

    public MustNiuNiuSeatPo() {}

    public MustNiuNiuSeatPo(int seat, String name) {
      this.seat = seat;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuExtrBetOptionPo {
    private int id;
    private int multiple;
    private String name;

    public MustNiuNiuExtrBetOptionPo() {}

    /**
     * 构造函数.
     */
    public MustNiuNiuExtrBetOptionPo(int id, int multiple, String name) {
      this.id = id;
      this.multiple = multiple;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuCardMultiplePo {
    private int id;
    private List<MultipleOptionPo> multiples;
    private String name;

    public MustNiuNiuCardMultiplePo() {}

    /**
     * 构造函数.
     */
    public MustNiuNiuCardMultiplePo(int id, List<MultipleOptionPo> multiples, String name) {
      this.id = id;
      this.multiples = multiples;
      this.name = name;
    }
  }

  @Data
  public static class MultipleOptionPo {
    private int niu;
    private int multiple;

    public MultipleOptionPo() {}

    public MultipleOptionPo(int niu, int multiple) {
      this.niu = niu;
      this.multiple = multiple;
    }
  }

  @Data
  public static class MustNiuNiuCardSpecialMultiplePo {
    private int id;
    private int niu;
    private int multiple;
    private String name;

    public MustNiuNiuCardSpecialMultiplePo() {}

    /**
     * 构造函数.
     */
    public MustNiuNiuCardSpecialMultiplePo(int id, int niu, int multiple, String name) {
      this.id = id;
      this.niu = niu;
      this.multiple = multiple;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuAdvanceOptionPo {
    private int id;
    private String name;

    public MustNiuNiuAdvanceOptionPo() {}

    public MustNiuNiuAdvanceOptionPo(MustNiuNiuAdvanceOption option) {
      this.id = option.id;
      this.name = option.name;
    }
  }

  @Data
  public static class MustNiuNiuBankerChipPo {
    private int id;
    private int chips;
    private String name;

    public MustNiuNiuBankerChipPo() {}

    /**
     * 构造函数.
     */
    public MustNiuNiuBankerChipPo(int id, int chips, String name) {
      this.id = id;
      this.chips = chips;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuCallBankerMultiplePo {
    private int multiple;
    private String name;

    public MustNiuNiuCallBankerMultiplePo() {}

    public MustNiuNiuCallBankerMultiplePo(int multiple, String name) {
      this.multiple = multiple;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuTrusteeBetOptionPo {
    private int niu; // 没牛:任意牌，8:牛8以上
    private int index; // 下注选项的下标

    public MustNiuNiuTrusteeBetOptionPo() {}

    public MustNiuNiuTrusteeBetOptionPo(int niu, int index) {
      this.niu = niu;
      this.index = index;
    }
  }

  @Data
  public static class MustNiuNiuTrusteeExtrBetOptionPo {
    private int niu; // -1:不推注,没牛:任意牌推注，8:牛8以上
    private String name; // 名称

    public MustNiuNiuTrusteeExtrBetOptionPo() {
      niu = -1;
      this.name = "不推注";
    }

    public MustNiuNiuTrusteeExtrBetOptionPo(int niu, String name) {
      this.niu = niu;
      this.name = name;
    }
  }

  @Data
  public static class MustNiuNiuTrusteeCallBankerOptionPo {
    private int niu; // 0:任意牌
    private int multiple; // 抢庄倍数(0:不抢庄，【自由抢庄: niu=0,multiple=1】)
    private String name;

    public MustNiuNiuTrusteeCallBankerOptionPo() {}

    /**
     * 构造函数.
     */
    public MustNiuNiuTrusteeCallBankerOptionPo(int niu, int multiple, String name) {
      this.niu = niu;
      this.multiple = multiple;
      this.name = name;
    }
  }
}
